import PictureService from '../service/picture-service';
import * as Koa from 'koa';

class PictureController {
  private service: PictureService = new PictureService();

  // 修改
  updatePicture = async (ctx: Koa.Context) => {
    await this.service.updatePicture(ctx);
  };
  // 查询
  searchPicture = async (ctx: Koa.Context) => {
    await this.service.searchPicture(ctx);
  };
  // 移出目录
  moveOut = async (ctx: Koa.Context) => {
    await this.service.moveOut(ctx);
  };
  // 添加为主图
  moveInMainPic = async (ctx: Koa.Context) => {
    await this.service.moveInMainPic(ctx);
  };
  // 移出精选
  moveOutExcellent = async (ctx: Koa.Context) => {
    await this.service.moveOutExcellent(ctx);
  };
  // 移出主图
  moveOutMainPic = async (ctx: Koa.Context) => {
    await this.service.moveOutMainPic(ctx);
  };
  // 移入精选
  moveInExcellent = async (ctx: Koa.Context) => {
    await this.service.moveInExcellent(ctx);
  };
  // 前端图片上传
  pictureUpload = async (ctx: Koa.Context) => {
    await this.service.pictureUpload(ctx);
  };
  uploadDataToMysql = async (ctx: Koa.Context) => {
    await this.service.uploadDataToMysql(ctx);
  };

  // 添加
  addPicture = async (ctx: Koa.Context) => {
    await this.service.addPicture(ctx);
  };

  // 删除
  delelePicture = async (ctx: Koa.Context) => {
    await this.service.delelePicture(ctx);
  };

  // 查询所有审核通过的图片
  appletSearchPicture = async (ctx: Koa.Context) => {
    await this.service.appletSearchPicture(ctx);
  };
  // 主图
  appletGetMainPicture = async (ctx: Koa.Context) => {
    await this.service.appletGetMainPicture(ctx);
  };
  // 查询图片 - 指定用户权限的所有
  appletSearchPersonPicture = async (ctx: Koa.Context) => {
    await this.service.appletSearchPersonPicture(ctx);
  };
}

export default new PictureController();
